<?php

include_once($cfgPaths['lib'].'cms/type/cmsEditType.o.inc.php');

class cmsEditTimeType extends cmsEditType {

 function registerFields () {
   $map[] = $this->name.'hour';
   $map[] = $this->name.'min';
   $map[] = $this->name.'sec';
   $this->map = &$map;
 }

 function render_html () {
  $html  = '<div class="xicstypeplugin">'."\n";
  $html .= '    <h3>'.$this->descr.':</h3>'.$this->showFields()."\n";
  $html .= '       <select tabindex="'.$this->sender->getNextTabindex($this->name.'hour').'" name="'.$this->name.'hour">'."\n";
  for ($i=0;$i<24;$i++) {
    $html .= "<option";
    if ($this->getValue($this->name.'hour')==$i) $html .= " Selected";
    $html .= ">";
    if ($i<10) $html .= '0';
    $html .= $i."</option>\n";
  }
    $html .= '</select> :'."\n";
    $html .= '<select tabindex="'.$this->sender->getNextTabindex($this->name.'min').'" name="'.$this->name.'min">'."\n";
  for ($i=0;$i<60;$i++) {
    $html .= "<option";
    if ($this->getValue($this->name.'min')==$i) $html .= " Selected";
    $html .= ">";
    if ($i<10) $html .= '0';
    $html .= "$i</option>\n";
  }
    $html .= '</select> :'."\n";
    $html .= '<select tabindex="'.$this->sender->getNextTabindex($this->name.'sec').'" name="'.$this->name.'sec">'."\n";
  for ($i=0;$i<60;$i++) {
    $html .= "<option";
    if ($this->getValue($this->name.'sec')==$i) $html .= " Selected";
    $html .= ">";
    if ($i<10) $html .= '0';
    $html .= "$i</option>\n";
  }
  $html .= '       </select>'."\n";
  $html  .= '</div><!-- / type time -->'."\n";
  return $html;
 }

 function render_javascript () {
 }

}


?>